<?php
/**
 * Created by IntelliJ IDEA.
 * User: huyu
 * Date: 16/8/18
 * Time: 下午12:39
 */
namespace app\models;

use Yii;
use yii\db\ActiveRecord;
class Postage_template extends ActiveRecord
{
    public function getAll()
    {
        $postageTemplates = Postage_template::find()->select(['id','name', 'default_unit_price'])->where(['del_flag'=>1])->asArray()->all();
        return $postageTemplates;
    }

    public function getDetails($id)
    {
        $detail = Postage_template_detail::find()->select(['postage_template_id', 'province_name','unit_price'])->where(['del_flag'=>1,'postage_template_id'=>$id])->asArray()->all();
        return $detail;
    }
}